package dvx.mp.ivisual.desktop.ui.util;

import java.text.NumberFormat;

import javax.swing.SwingConstants;

public class GridNumberRenderer extends GridFormatRenderer	{
	/***/
	private static final long serialVersionUID = 1L;

	/*
	 *  Use the specified number formatter and right align the text
	 */
	public GridNumberRenderer(NumberFormat formatter)
	{
		super(formatter);
		setHorizontalAlignment( SwingConstants.RIGHT );
	}

	/*
	 *  Use the default currency formatter for the default locale
	 */
	public static GridNumberRenderer getCurrencyRenderer()
	{
		return new GridNumberRenderer( NumberFormat.getCurrencyInstance() );
	}

	/*
	 *  Use the default integer formatter for the default locale
	 */
	public static GridNumberRenderer getIntegerRenderer()
	{
		return new GridNumberRenderer( NumberFormat.getIntegerInstance() );
	}

	/*
	 *  Use the default percent formatter for the default locale
	 */
	public static GridNumberRenderer getPercentRenderer()
	{
		return new GridNumberRenderer( NumberFormat.getPercentInstance() );
	}
}
